<?php

namespace app\admin\validate;

use think\Validate;

class BaseValidate extends Validate
{
    protected $rule = [
        'id' => 'require',
        'page' => 'require|integer',
        'pageSize' => 'require|integer',
        'search' => 'array'
    ];

    protected $message = [
        'id.require' => 'id参数必须',
        'page.require' => 'page参数必须',
        'page.int' => 'page参数必须是整数',
        'pageSize.require' => 'pageSize参数必须',
        'pageSize.int' => 'pageSize参数必须是整数',
        'search.array' => 'search参数必须是数组'
    ];

    protected $scene = [
        'retrieve' => ['page', 'pageSize', 'search'],
        'detail' => ['id'],
        'delete' => ['id'],
    ];
}